package com.yuedao.sender.model1;

import javax.persistence.*;

/**
 * AssistDemo
 * com.chris.demo.model.orm
 * Created by Chris Chen
 * 2018/1/5
 * Explain:
 */
@Entity(name = "ydx_promotion_algorithms")
public class PromotionAlgorithmEntity {
    private int id;
    private int promotionNo;
    private String promotionName;
    private Double amountOffForRegular;
    private Double percentOffForRegular;
    private Double amountOffForAirport;
    private Double percentOffForAirport;
    private Double amountOffForCharter;
    private Double percentOffForCharter;
    private Integer available;
    private String description;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "promotion_no", nullable = false)
    public int getPromotionNo() {
        return promotionNo;
    }

    public void setPromotionNo(int promotionNo) {
        this.promotionNo = promotionNo;
    }

    @Basic
    @Column(name = "promotion_name", nullable = true, length = 128)
    public String getPromotionName() {
        return promotionName;
    }

    public void setPromotionName(String promotionName) {
        this.promotionName = promotionName;
    }

    @Basic
    @Column(name = "amount_off_for_regular", nullable = true, precision = 2)
    public Double getAmountOffForRegular() {
        return amountOffForRegular;
    }

    public void setAmountOffForRegular(Double amountOffForRegular) {
        this.amountOffForRegular = amountOffForRegular;
    }

    @Basic
    @Column(name = "percent_off_for_regular", nullable = true, precision = 2)
    public Double getPercentOffForRegular() {
        return percentOffForRegular;
    }

    public void setPercentOffForRegular(Double percentOffForRegular) {
        this.percentOffForRegular = percentOffForRegular;
    }

    @Basic
    @Column(name = "amount_off_for_airport", nullable = true, precision = 2)
    public Double getAmountOffForAirport() {
        return amountOffForAirport;
    }

    public void setAmountOffForAirport(Double amountOffForAirport) {
        this.amountOffForAirport = amountOffForAirport;
    }

    @Basic
    @Column(name = "percent_off_for_airport", nullable = true, precision = 2)
    public Double getPercentOffForAirport() {
        return percentOffForAirport;
    }

    public void setPercentOffForAirport(Double percentOffForAirport) {
        this.percentOffForAirport = percentOffForAirport;
    }

    @Basic
    @Column(name = "amount_off_for_charter", nullable = true, precision = 2)
    public Double getAmountOffForCharter() {
        return amountOffForCharter;
    }

    public void setAmountOffForCharter(Double amountOffForCharter) {
        this.amountOffForCharter = amountOffForCharter;
    }

    @Basic
    @Column(name = "percent_off_for_charter", nullable = true, precision = 2)
    public Double getPercentOffForCharter() {
        return percentOffForCharter;
    }

    public void setPercentOffForCharter(Double percentOffForCharter) {
        this.percentOffForCharter = percentOffForCharter;
    }

    @Basic
    @Column(name = "available", nullable = true)
    public Integer getAvailable() {
        return available;
    }

    public void setAvailable(Integer available) {
        this.available = available;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 2048)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PromotionAlgorithmEntity that = (PromotionAlgorithmEntity) o;

        if (id != that.id) return false;
        if (promotionNo != that.promotionNo) return false;
        if (promotionName != null ? !promotionName.equals(that.promotionName) : that.promotionName != null)
            return false;
        if (amountOffForRegular != null ? !amountOffForRegular.equals(that.amountOffForRegular) : that.amountOffForRegular != null)
            return false;
        if (percentOffForRegular != null ? !percentOffForRegular.equals(that.percentOffForRegular) : that.percentOffForRegular != null)
            return false;
        if (amountOffForAirport != null ? !amountOffForAirport.equals(that.amountOffForAirport) : that.amountOffForAirport != null)
            return false;
        if (percentOffForAirport != null ? !percentOffForAirport.equals(that.percentOffForAirport) : that.percentOffForAirport != null)
            return false;
        if (amountOffForCharter != null ? !amountOffForCharter.equals(that.amountOffForCharter) : that.amountOffForCharter != null)
            return false;
        if (percentOffForCharter != null ? !percentOffForCharter.equals(that.percentOffForCharter) : that.percentOffForCharter != null)
            return false;
        if (available != null ? !available.equals(that.available) : that.available != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + promotionNo;
        result = 31 * result + (promotionName != null ? promotionName.hashCode() : 0);
        result = 31 * result + (amountOffForRegular != null ? amountOffForRegular.hashCode() : 0);
        result = 31 * result + (percentOffForRegular != null ? percentOffForRegular.hashCode() : 0);
        result = 31 * result + (amountOffForAirport != null ? amountOffForAirport.hashCode() : 0);
        result = 31 * result + (percentOffForAirport != null ? percentOffForAirport.hashCode() : 0);
        result = 31 * result + (amountOffForCharter != null ? amountOffForCharter.hashCode() : 0);
        result = 31 * result + (percentOffForCharter != null ? percentOffForCharter.hashCode() : 0);
        result = 31 * result + (available != null ? available.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        return result;
    }
}
